import Vue from 'vue'
import App from './App.vue'
import router from './router'
import 'vant/lib/index.css';//vant样式
import { Sticky, NavBar } from 'vant';
Vue.use(Sticky).use(NavBar);

Vue.prototype.$device = getDevice()
Vue.config.productionTip = false

const appVue = new Vue({
  router,
  render: h => h(App)
}).$mount('#app')

export default appVue
function getDevice() {
  let inBrowser = typeof window !== 'undefined';
  // let inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  // let weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  let UA = inBrowser && window.navigator.userAgent.toLowerCase();
  // var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  let isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA))

  return isIOS ? 'ios' : 'android'
}